home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak 52
/
Volume 52 - JOGO DISK .iso
/
Games
/
shopdrop.swf
/
scripts
/
__Packages
/
ScrollBuilding.as
< prev
next >
Wrap
Text File
|
2007-09-27
|
1KB
|
45 lines
class ScrollBuilding extends MovieClip
{
var nTypes = 4;
function ScrollBuilding()
{
super();
this.aTypes = [];
this.aTypes.push(this.getBuildingType());
this.aTypes.push(this.getBuildingType());
this.aTypes.push(this.getBuildingType());
this.aBuildings = [this.bld2,this.bld1,this.bld0];
this.showBuildings();
}
function jump()
{
this.aTypes.splice(0,1);
var _loc2_ = this.getBuildingType();
this.aTypes.push(_loc2_);
this.showBuildings();
}
function getBuildingType()
{
var _loc2_ = undefined;
if(this.aTypes.length > 0)
{
do
{
_loc2_ = Math.ceil(Math.random() * this.nTypes);
}
while(_loc2_ == this.aTypes[this.aTypes.length - 1]);
}
return _loc2_;
}
function showBuildings()
{
var _loc2_ = 0;
while(_loc2_ < this.aBuildings.length)
{
this.aBuildings[_loc2_].gotoAndStop(this.aTypes[_loc2_]);
_loc2_ = _loc2_ + 1;
}
}
}